package com.maschinenstuermer.profiler.transform;

import org.ow2.util.asm.Type;

class MethodDescriptionConverter {
	private MethodDescriptionConverter() {
		// this is a static helper!
	}
	
	public static String convert(final String methodDesc) {
		final StringBuffer buffer = new StringBuffer("(");
		final Type[] argumentTypes = Type.getArgumentTypes(methodDesc);
		for (int i = 0; i < argumentTypes.length; i++) {
			if (i > 0) {
				buffer.append(",");
			}
			buffer.append(argumentTypes[i].getClassName());
		}
		buffer.append("):").append(Type.getReturnType(methodDesc).getClassName());
		return buffer.toString();
	}
}
